<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      const attr1 = "size";
      const attr2 = () => "width"; // function(){return "width"}
      const info = {
        [attr1]: 100, // size:100
        ["hei" + "ght"]: 200,
        [attr2()]: 300, // width:300
        name: "jack",
        age: 20,
        "max number": 100,
        "@#^&*": "other",
      };
      console.log(info);
      console.log(info[attr2()]); //info["width"]
    </script>
  </body>
</html>
